var MD={};
MD.layerDir="/res/mpe/js/plug/layer/";

;(function(){
    /*IE8下未开启调试，console出现错误提示兼容*/
    window.console = window.console || {};
    window.console.log = window.console.log || function(){};
    var getCookie = function(name){
        var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
        if(arr != null){
            return unescape(arr[2]);
        }
        return null;
    };
    /* Local variable */
    var host    = "//" + location.host;
    var debug  = getCookie("debugFlag") ? true : false;
    //var debug  = true;


    var config={
        //模块系统的基础路径
        base: '/res/mpe/js/',
        vars : {

        },
        //别名
        alias: {
            /* 第三方库 */
            "jquery":"plug/jquery_forseajs/jquery.js",
            "layer":"plug/layer/layer.js",
            "validate":"plug/validate/validate.js",
            "jArea":"plug/area/jAreaSelect.js",
            "template":"plug/artTemplate/artTemplate.js",
            "my97":"plug/my97/WdatePicker.js",
            "bankSelector":"plug/bankSelector/bankSelector.js",
            "ajaxFileUpload":"plug/ajaxFileUpload/ajaxFileUpload.js",

            /*共用js*/
            "common":"common.js",
            "toolbar":"toolbar.js",

            /*member 页面js*/
            "order_car":"member/order_car.js",
            "login":"member/login.js",
            /*web页面js*/
            "index":"web/index.js",
            "info":"web/info.js",
            "pro":"web/pro.js"


        },
        preload:[
            "jquery"
        ],

        //错误信息查看
        debug: true,

        //文件映射
        map: [
            //可配置版本号
            //['.css', '.css?v=' + version],
            //['.js', '.js?v=' + version]
        ],

        // 文件编码
        charset:function(url){
            if(url.indexOf(".gbk.")>-1){
                return "GBK";
            }
            return "UTF-8";
        }
    };
    var alias = config.alias;
    //var v = typeof(rev) == "undefined" ? '' : '?v='+rev;
    var suffix = (debug ? ".js" : "-min.js");
    for (var key in alias){
        if(alias[key].indexOf("-min")==-1 && alias[key].indexOf("JAreaSelect")==-1 && alias[key].indexOf("WdatePicker")==-1 && alias[key].indexOf("bankselector.js")==-1  && alias[key].indexOf(".js")!=-1){
            alias[key] = alias[key].replace(/\.js/, suffix);
        }
    }
    seajs.config(config);
})();